import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str1 = sc.nextLine();
        String str2 = sc.nextLine();
        int len = str1.length();
        //记录回文的次数
        int n = 0;
        for (int i = 0; i <= len; i++) {
            //将字符串2插入到字符串1的每个位置，再判断是否回文
            StringBuffer str = new StringBuffer(str1);
            str.insert(i,str2);
            StringBuffer tmp = new StringBuffer(str);
            //将插入str2后的数组反转，比较其与原数组是否相同
            StringBuffer str3 = tmp.reverse();
            if (str.toString().equals(str3.toString())){
                n++;
            }
        }
        System.out.println(n);
    }
}
